Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transaction chunking on QUIC batch send #26642

Merged
merged 2 commits into from
Jul 22, 2022

Conversation

pgarg66
Copy link
Contributor

@pgarg66 pgarg66 commented Jul 15, 2022

Problem

The chunking logic was reversed. It was always creating chunks, where each chunk contains 128 transactions. So if a batch had 20,000 transactions, it'll create 157 chunks. For a batch of 100 transactions, it'll create only 1 chunk.

The batching code will work better if we can create more chunks, so that multiple streams can be used to transmit the transactions in parallel.

Summary of Changes

This PR reverses the chunking logic. It'll try to create up to QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS chunks now. For a 100 transaction batch, it'll create 100 chunks. Any batch with more than QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS transactions will have QUIC_MAX_UNSTAKED_CONCURRENT_STREAMS chunks.

This change uncovered some issues on the streamer side of code as well. If the client is a staked node, but doesn't have enough stake, the receiver will not allocate enough QUIC streams for it. See here for more analysis of this #26340 (comment)

This PR adds some improvements on the streamer side as well, to assign a minimal number of streams to a staked client. More cleanup/fixes are needed to address all the concerns in #26340

Fixes #

@pgarg66
Copy link
Contributor Author

pgarg66 commented Jul 15, 2022

On master

image

With the PR

image

@pgarg66 pgarg66 marked this pull request as ready for review July 15, 2022 19:43
@pgarg66 pgarg66 requested a review from sakridge July 15, 2022 19:46
Copy link
Member

@sakridge sakridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@pgarg66 pgarg66 merged commit 27866ae into solana-labs:master Jul 22, 2022
@pgarg66 pgarg66 deleted the fix-chunking branch July 22, 2022 15:56
lijunwangs pushed a commit to lijunwangs/solana that referenced this pull request Sep 10, 2022
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
lijunwangs pushed a commit to lijunwangs/solana that referenced this pull request Sep 13, 2022
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
lijunwangs pushed a commit to lijunwangs/solana that referenced this pull request Sep 13, 2022
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
lijunwangs pushed a commit to lijunwangs/solana that referenced this pull request Sep 13, 2022
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
lijunwangs pushed a commit that referenced this pull request Sep 14, 2022
* Fix chunking of transaction at batch transmit via QUIC

* clippy fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants